package com.example.flow.pipeline.handlers;

import com.alibaba.fastjson.JSON;
import com.example.flow.pipeline.core.AbstractFlowHandler;
import com.example.flow.pipeline.model.DemoPipeContext;
import com.example.flow.pipeline.model.result.FlowResult;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description RouteHandler
 * @Author yangbin094
 * @Date 2021/8/27 2:16 下午
 */
@Slf4j
public class RouteHandler extends AbstractFlowHandler {

    @Override
    public FlowResult<?> handle() {
        DemoPipeContext context = (DemoPipeContext) getPipeline().pipeContext();
        log.info("RouteValve=" + JSON.toJSONString(context));
        context.setName("RouteValve");
        return FlowResult.ok();
    }

}
